import 'package:flutter/widgets.dart';
import 'package:full_display/common/qxp_color.dart';
import 'package:full_display/unit/asset_utils/asset_utils.dart';
import 'package:full_display/unit/screen/screen_utility.dart';

class ItemMedia extends StatelessWidget {
  final String bottomTitle;

  const ItemMedia({Key? key, required this.bottomTitle}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 104.0.W,
      height: 130.0.H,
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          SizedBox(
            width: 104.0.W,
            height: 104.0.H,
            child: Stack(
              children: [
                SizedBox(
                  width: 104.0.W,
                  height: 104.0.H,
                  child: Image.asset(
                    AssetUtils.getAssetImage('icon_pause'),
                    fit: BoxFit.fill,
                  ),
                ),
                Container(
                    padding: const EdgeInsets.all(28),
                    child: Image.asset(
                      AssetUtils.getAssetImage('icon_pause'),
                      fit: BoxFit.fill,
                    )),
                Positioned(
                    right: 4.0.W,
                    bottom: 4.0.H,
                    child: Container(
                      alignment: Alignment.center,
                      constraints: BoxConstraints(minWidth: 30.0.W),
                      height: 14.0.H,
                      decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(8),
                          color: ColorPlate.black.withOpacity(0.5)),
                      child: Text(
                        '20S',
                        style: TextStyle(
                            fontSize: 10.0.SP, color: ColorPlate.white),
                      ),
                    ))
              ],
            ),
          ),
          const Expanded(flex: 1, child: SizedBox()),
          Container(
            height: 26.0.H,
            alignment: Alignment.bottomCenter,
            child: Text(
              bottomTitle,
              style: TextStyle(color: ColorPlate.white, fontSize: 12.0.SP),
            ),
          )
        ],
      ),
    );
  }
}
